﻿using Leo.Awesome.DictionaryManagement.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using static Leo.Awesome.DictionaryManagement.Permissions.DictionaryManagementPermissions;
namespace Leo.Awesome.DictionaryManagement.Permissions;

public class DictionaryManagementPermissionDefinitionProvider : PermissionDefinitionProvider
{
    public override void Define(IPermissionDefinitionContext context)
    {
        var myGroup = context.AddGroup(DictionaryManagementPermissions.GroupName);

        myGroup.AddPermission(AppPlatformDataDictionaryCreate, L(AppPlatformDataDictionaryCreate));
        myGroup.AddPermission(AppPlatformDataDictionaryEdit, L(AppPlatformDataDictionaryEdit));
        myGroup.AddPermission(AppPlatformDataDictionaryDelete, L(AppPlatformDataDictionaryDelete));
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<DictionaryManagementResource>(name);
    }
}
